#define NS_LOG_APPEND_CONTEXT                                   \
  if (m_ipv4) { std::clog << "[node " << m_ipv4->GetObject<Node> ()->GetId () << "] "; }

#include "sls.h"
#include "ns3/log.h"
#include "ns3/mobility-model.h"
#include "ns3/node-list.h"
#include "ns3/node.h"

NS_LOG_COMPONENT_DEFINE ("SimpleLocationService");

namespace ns3
{
NS_OBJECT_ENSURE_REGISTERED (SimpleLocationService);


SimpleLocationService::SimpleLocationService (Time tableLifeTime = Time(0)) : m_table(tableLifeTime)
{}

SimpleLocationService::~SimpleLocationService ()
{}

void
SimpleLocationService::DoDispose ()
{
  return;
}

void
SimpleLocationService::Start ()
{
  return;
}

Vector
SimpleLocationService::GetPosition(Ipv4Address adr)
{
  NS_LOG_UNCOND ("GET POSITION CALLED");

  MapEntry m = GetEntry(adr);

  Vector auxVPos = m.GetPosition();
  //int auxspeed = m.GetSpeed();
  //Time auxtime = m.GetTime();

  return auxVPos;
}

bool
SimpleLocationService::HasPosition(Ipv4Address adr)
{
	NS_LOG_UNCOND ("HAS POSITION CALLED");
	return true;
}

bool
SimpleLocationService::IsInSearch(Ipv4Address adr)
{
	return false;
}

void
SimpleLocationService::SetIpv4 (Ptr<Ipv4> ipv4)
{
	return;
}

Vector
SimpleLocationService::GetInvalidPosition ()
{
	return Vector(-1, -1, 0);
}



  void
  SimpleLocationService::Purge ()
  {
    return;
  }

  void
  SimpleLocationService::Clear ()
  {
    return;
  }


}
